package Teste;

import Passageiros.DAOException;
import Passageiros.StatusReservasDAO;
import Vo.StatusReservasVO;

public class TesteStatusReservas 
{
	public void inserir( )
	{
		try 
		{
			StatusReservasDAO dao = new StatusReservasDAO( ) ;
			
			StatusReservasVO  statusReserva = new StatusReservasVO ( ) ;
			statusReserva.setCodigoStatusReservas( 1 ) ;
			statusReserva.setDescricaoStatusReservas("Confirmada") ;
				
			dao.inserirStatusReserva( statusReserva ) ;
		} 
		catch ( DAOException e ) 
		{
			e.printStackTrace();
		}
	}
	
	public void alterar( )
	{
		try 
		{
			StatusReservasDAO dao = new StatusReservasDAO( ) ;
			
			StatusReservasVO statusReserva = new StatusReservasVO( ) ;
			statusReserva.setCodigoStatusReservas( 1 ) ;
			statusReserva.setDescricaoStatusReservas("Confirmada") ;
				
			dao.alterarStatusReserva(statusReserva) ;
		} 
		catch ( DAOException e ) 
		{
			e.printStackTrace();
		}
	}
	
	public void excluir( )
	{
		try 
		{
			StatusReservasDAO dao = new StatusReservasDAO( ) ;
			
			StatusReservasVO statusReserva = new StatusReservasVO( ) ;
			statusReserva.setCodigoStatusReservas( 1 ) ;
		
			dao.excluirStatusReserva( statusReserva ) ;
		
		} 
		catch ( DAOException e ) 
		{
			e.printStackTrace();
		}
	}
	
	public void consultar( )
	{
		try 
		{
			StatusReservasDAO dao = new StatusReservasDAO( );
			
			StatusReservasVO statusReserva = dao.consultarStatusReserva( 1 ) ;
			
			if ( statusReserva != null ) 
			{
				System.out.println(" *** Reservas Consultadas *** ");
				System.out.println( " Nome: " 	+ statusReserva.getDescricaoStatusReservas( ));	
			}
		} 
		catch ( DAOException e ) 
		{
			e.printStackTrace();
		}
	}
	
	public static void main( String[] args ) 
	{
		TesteStatusReservas testarStatusReserva = new TesteStatusReservas( ) ;
		
		testarStatusReserva.inserir( ) ;

		testarStatusReserva.alterar( ) ;

		testarStatusReserva.consultar( ) ;

        //testarStatusReserva.excluir( ) ;
	}
}
